home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / envoy / envoysupport.lha / EnvoySupport / src / nipclib.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-26  |  675 b   |  33 lines

  1. void __regargs __autoopenfail(char *);
  2.  
  3. #include <constructor.h>
  4. #include <proto/nipc.h>
  5.  
  6. extern struct Library *OpenLibrary( UBYTE *libName, unsigned long version );
  7. extern void CloseLibrary( struct Library *library );
  8.  
  9. struct Library *NIPCBase ;
  10. static void *libbase;
  11. extern long __netlibversion;
  12.  
  13. CBMLIB_CONSTRUCTOR(opennipc)
  14. {
  15.     NIPCBase = libbase = (void *)OpenLibrary("nipc.library", __netlibversion);
  16.     if (NIPCBase == NULL) 
  17.     {
  18.         __autoopenfail("nipc.library");
  19.         return 1;
  20.     }
  21.     
  22.     return 0;
  23. }
  24.  
  25. CBMLIB_DESTRUCTOR(closenipc)
  26. {
  27.     if (libbase)
  28.     {
  29.         CloseLibrary((struct Library *)libbase);
  30.         libbase = NIPCBase = NULL;
  31.     }
  32. }
  33.